<extend name="Public/base"/>
<block name="head">
	<link href="__MOBILE__/css/article.css" rel="stylesheet">
</block>
<block name="body">
	<div class="container" >

        <div class="row">
			<div class="col-md-8">
				<div class="col-md-12 main-title" >
					<h3 class="col-md-12 article-title">{$info.title}</h3>
					<div clas="col-md-12">
						<span class="col-md-6">{$info.create_time|date='Y-m-d H:i:s',###}</span>
						<span class="col-md-6">
							<i class="glyphicon glyphicon-eye-open"></i>
										{$info.view}
							</span>
					</div>
					
				</div>
				
				<div class="col-md-12 main-content">
					
					<img class="img-responsive" src="{$info.cover_id|get_cover=path}">
					<section id="contents">{:get_tag_url($info['id'],$info['content'])}</section>
				</div>
				<div class="bdsharebuttonbox col-xs-12" data-tag="share_1">
					<ul class="col-xs-6 post-info padding-clear">
						<li class="info-item">
							<i class="glyphicon glyphicon-eye-open"></i>
							<span>{$info.view}</span>			
						</li>
						<li class="info-item">
							<i class="glyphicon glyphicon-share"></i>
							<span class="bds_count" data-cmd="count"></span>
						</li>
					</ul>
					<div class="ke-shares col-xs-6 padding-clear" >
						<span>分享</span>						
						<a class="share-icon icon-qzone" data-cmd="qzone" href="{:U('Article/detail',array('id'=>$info['id']),true,true)}"></a>
						<a class="share-icon icon-tsina" data-cmd="tsina"></a>
						
					</div>
					{:hook('documentDetailAfter',$info)}
				</div>
				<div class="col-xs-12">
					<notempty name="info.tag">
					<p class="tags">
						<em>继续阅读：</em>
						<volist name="info.tag" id="vo">
							<a class="content_tag" href="{:U('Article/tag',array('id'=>$vo['id']))}">{$vo.tag_name}</a>
						</volist>
					</p>
					</notempty>
				</div>
				<div class="col-xs-12 comment">
					<h5>评论</h5>
					<ul class="padding-clear">
						<notempty name="comment_list">
							<volist name="comment_list" id="vo">
							<li class="comment-cell col-xs-12 padding-clear">
								<div class="comment-user col-xs-2 padding-clear">
									<div class="avatar">
										<img alt="{$vo.nickname}" src="{$vo.avatar}">
									</div>
									<div class="user">{$vo.nickname}</div>
								</div>
								<div class="comment-body col-xs-10 padding-clear">
									<div class="comment-content col-xs-12 padding-clear">
										{$vo.content}
									</div>
									<div class="comment-operate col-xs-12 padding-clear">
										<div class="create-time">{$vo.create_time|date='Y-m-d H:i:s',###}</div>
									</div>
								</div>
							</li>
							</volist>
						</notempty>
					</ul>
				</div>
				<div class="col-xs-12">
					<form class="form-horizontal" method="post" action="{:U('Article/comment')}">
						<textarea class="form-control" name="content" rows="3"></textarea>
						<input type="hidden" name="object_id" value="{$info['id']}">
						<button class="ajax-post btn btn-success fr" style="margin-top:20px;" type="submit" target-form="form-horizontal">提交评论</button>
					</form>
				</div>
				

			</div>
			
        </div>
    </div>
    <script>
    showGoodsImgInArticle = "{:C('SHOW_GOODS_IMG_IN_ARTICLE')}";
	var img = '';
	$(function(){
		$('#contents').find('img').each(function(){
			$(this).addClass('img-responsive');
		});
		$('#contents').find('.article-goods').each(function(){
			var id = $(this).attr('name');
			var p  = $(this).parent();
			
			if(id!='' && id!='undefinded'){
				$.post("{:U('Goods/buttonInfo')}", {'id':id}, function (result) { 
    				if(result.errno <=0){
    					goods = result.content;
    					var title = '<h5 class= "goods-title">'+goods.name+'</h5>'
    					if(showGoodsImgInArticle >0){
    						img = '<img class="img-responsive goods-img" src="'+goods.src+'">';
    					}
    					var div = title+img+'<div>'+'<span class="price">￥:'+goods.price+'</span>'+'<a class="btn btn-circle" href="'+goods.url+'"><span>查看详细</span></a>'+'</div>';
    					p.html(div);
    					p.addClass('goods-extend');
    				}else{
    					p.remove();
    				}
    			},'json');
			}
			
		});
		heightlight_bottom_nav("{$default_url}"); 
	});

    	
    	window._bd_share_config = {
    		common : {
    			bdText : '{$info.title}',	
    			bdDesc : '{$info.description}',	
    			bdUrl : '{:U("Article/detail",array("id"=>$info["id"]),true,true)}', 	
    			bdPic : '{:C("WEB_SITE_URL")}{$info.cover_id|get_cover=path}'
    		},
    		share : [{
    			"bdSize" : 16
    		}]
    	}
    	with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)];
    </script>
</block>

